package com.example.demo.dao;


import com.example.demo.domain.Role;
import com.example.demo.support.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;

@RepositoryRestResource(path = "role")
public interface RoleReposity extends CustomRepository<Role,Long> {
    Role findByName(String name);

    @Query("select r from Role r where r.name= :name")


    @RestResource(path = "nameStartsWith", rel = "nameStartsWith")
    Role findByNameStartsWith(@Param("name") String name);

}
